/**
 * Copyright (c) 2016-2019 九点科技 All rights reserved.
 *
 * http://www.9dyun.cn
 *
 * 版权所有，侵权必究！
 */
package com.dian.modules.inv.dao;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.dian.common.utils.Date;
import com.dian.modules.inv.entity.InLineEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dian.modules.inv.vo.GoodsStockVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * 入库单明细
 *
 * @author xiaolai
 * @email xiaolai@9dyun.cn
 * @date 2019-06-11 00:12:45
 */
@Mapper
public interface InLineDao extends BaseMapper<InLineEntity> {

    /**
     * 修改明细入库月份
     */
    @SqlParser(filter = true)
    @Update("update inv_in_line set in_month=#{inMonth},in_state=#{inState}  where in_id=#{inId}")
    void updateInMonth(@Param("inId")Long inId, @Param("inMonth")String inMonth,@Param("inState")Integer inState);


    /**
     * 查询指定商品本月有效入库数量
     * @param inMonth       入库月份
     * @param goodsId       商品Id
     * @param colorNumber   商品色号
     * @param itemGrade     商品等级
     * @return
     */
    GoodsStockVO queryInGoodsQty(
             @Param("warehouseId")Long warehouseId,
             @Param("inMonth")String inMonth,
             @Param("goodsId")Long goodsId,
             @Param("colorNumber")String colorNumber,
             @Param("itemGrade")Integer itemGrade
     );
}
